/*
******************************************************************************************************* 
**  Copyright (C) 2019, 苏州检易生物科技有限公司 
**  All rights reserved. 
** 
**  FileName:       	schedule.c
**  Description:	
**  Author:        	 
**  Version				v0.1
**  Date:           	2019-07-15
**	Function List： 
**  History:         
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                              	调试开关
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                             INCLUDE FILES
*********************************************************************************************************
*/
#include <rtthread.h>
#include "schedule_period.h"
#include "log_console.h"
/*
*********************************************************************************************************
*                                              	宏定义
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*                                              	函数原型声明
*********************************************************************************************************
*/
static uint32_t schedule_get_period(test_process_t process_index);
/*
*********************************************************************************************************
*                                              	模块静态变量定义
*********************************************************************************************************
*/
#if PRODUCT_NAME_DESKTOP_200  | PRODUCT_NAME_IVD_SAMPLE | PRODUCT_NAME_IVD_DEBUG
static method_act_t normal_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_R2|TEST_PROCESS_SAMPLE},
#if REACTION_MIX_OLD
	{4,TEST_RROCESS_SHAKE_SAMPLE},
#else
	{1,TEST_RROCESS_SHAKE_SAMPLE},
#endif
	{20,TEST_PROCESS_MAGNET},
#if REACTION_MIX_OLD
	{24,TEST_PROCESS_SHAKE_MAGNET},
#else
	{21,TEST_PROCESS_SHAKE_MAGNET},
#endif
	{39,TEST_PROCESS_GO_CLEAN},
	{42,TEST_PROCESS_SUCK_P1},
	{43,TEST_PROCESS_SPIT_P1},
	{44,TEST_PROCESS_SUCK_P2},
	{45,TEST_PROCESS_SPIT_P2},
	{46,TEST_PROCESS_SUCK_P3},
	{47,TEST_PROCESS_SPIT_P3},
	{48,TEST_PROCESS_SUCK_P4|TEST_PROCESS_REAGENTA},
	{49,TEST_PROCESS_SHAKE_REAGENTA},
	{50,TEST_PROCESS_PMT|TEST_PROCESS_FLASH},
	{51,TEST_PROCESS_WASTE},
};
static method_act_t dilute_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_RROCESS_DILUTE|TEST_PROCESS_SAMPLE},
	{1,TEST_RROCESS_SHAKE_SAMPLE},
	{5,TEST_RROCESS_DILUTE_SHIFT},
//	{5,TEST_RROCESS_DILUTE_NEW},
//	{5,TEST_RROCESS_DILUTE_SHIFT},
	{39,TEST_PROCESS_GO_CLEAN},
	{42,TEST_PROCESS_SUCK_P1},
	{50,TEST_PROCESS_PMT},
	{51,TEST_PROCESS_WASTE},
};
static method_act_t r2m_method_list[]={
//#if PRODUCT_NAME_DESKTOP_200_V4
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_SAMPLE},
	{1,TEST_RROCESS_SHAKE_SAMPLE},
//#else
//	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1},
//	{1,TEST_PROCESS_SAMPLE},
//	{5,TEST_RROCESS_SHAKE_SAMPLE},
//#endif
	{20,TEST_PROCESS_R2_DL|TEST_PROCESS_MAGNET},
	{21,TEST_PROCESS_SHAKE_MAGNET},
	{39,TEST_PROCESS_GO_CLEAN},
	{42,TEST_PROCESS_SUCK_P1},
	{43,TEST_PROCESS_SPIT_P1},
	{44,TEST_PROCESS_SUCK_P2},
	{45,TEST_PROCESS_SPIT_P2},
	{46,TEST_PROCESS_SUCK_P3},
	{47,TEST_PROCESS_SPIT_P3},
	{48,TEST_PROCESS_SUCK_P4|TEST_PROCESS_REAGENTA},
	{49,TEST_PROCESS_SHAKE_REAGENTA},
	{50,TEST_PROCESS_PMT|TEST_PROCESS_FLASH},
	{51,TEST_PROCESS_WASTE},
};
static method_act_t fast_method_list[]={
//#if PRODUCT_NAME_DESKTOP_200_V4
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_R2|TEST_PROCESS_MAGNET|TEST_PROCESS_SHAKE_MAGNET|TEST_PROCESS_SAMPLE},
	{1,TEST_RROCESS_SHAKE_SAMPLE},
//#else
//	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_R2|TEST_PROCESS_MAGNET|TEST_PROCESS_SHAKE_MAGNET},
//	{1,TEST_PROCESS_SAMPLE|TEST_RROCESS_SHAKE_SAMPLE},
//#endif
	{2,TEST_PROCESS_GO_CLEAN},
	{5,TEST_PROCESS_SUCK_P1},
	{6,TEST_PROCESS_SPIT_P1},
	{7,TEST_PROCESS_SUCK_P2},
	{8,TEST_PROCESS_SPIT_P2},
	{9,TEST_PROCESS_SUCK_P3},
	{10,TEST_PROCESS_SPIT_P3},
	{11,TEST_PROCESS_SUCK_P4|TEST_PROCESS_REAGENTA},
	{12,TEST_PROCESS_SHAKE_REAGENTA},
	{13,TEST_PROCESS_PMT|TEST_PROCESS_FLASH},
	{14,TEST_PROCESS_WASTE},
};
static method_act_t two_step_method_list[]={
//#if PRODUCT_NAME_DESKTOP_200_V4
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_SAMPLE},
	{1,TEST_RROCESS_SHAKE_SAMPLE},
//#else
//	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1},
//	{1,TEST_PROCESS_SAMPLE},
//	{5,TEST_RROCESS_SHAKE_SAMPLE},
//#endif
	{20,TEST_PROCESS_MAGNET},
	{21,TEST_PROCESS_SHAKE_MAGNET},
	{39,TEST_PROCESS_GO_CLEAN},
	{42,TEST_PROCESS_SUCK_P1},
	{43,TEST_PROCESS_SPIT_P1},
	{44,TEST_PROCESS_SUCK_P2},
	{45,TEST_PROCESS_SPIT_P2},
	{46,TEST_PROCESS_SUCK_P3},
	{47,TEST_PROCESS_SPIT_P3},
	{48,TEST_PROCESS_SUCK_P4},
	{50,TEST_PROCESS_RELOAD|TEST_PROCESS_R2|TEST_PROCESS_SHAKE_MAGNET},
	{70,TEST_PROCESS_SHAKE_MAGNET},
	{89,TEST_PROCESS_GO_CLEAN},
	{92,TEST_PROCESS_SUCK_P1},
	{93,TEST_PROCESS_SPIT_P1},
	{94,TEST_PROCESS_SUCK_P2},
	{95,TEST_PROCESS_SPIT_P2},
	{96,TEST_PROCESS_SUCK_P3},
	{97,TEST_PROCESS_SPIT_P3},
	{98,TEST_PROCESS_SUCK_P4|TEST_PROCESS_REAGENTA},
	{99,TEST_PROCESS_SHAKE_REAGENTA},
	{100,TEST_PROCESS_PMT|TEST_PROCESS_FLASH},
	{101,TEST_PROCESS_WASTE},
};
//#if PRODUCT_NAME_DESKTOP_200_V4
/*反应盘运动格子数量									装新杯|去清洗|两步法重新温育|加试剂|加磁珠|吸取稀释样本|加样本|摇匀*/
static uint8_t rnd_grid[8] = {				10,			1,		19,							6,			0,		0,					5,			0};
static uint8_t rnd_test_grid[8] = {		10,			18,		0,							8,			0,		0,					5,			0};
//#else
///*反应盘运动格子数量									装新杯|去清洗|两步法重新温育|加试剂|加磁珠|吸取稀释样本|加样本|摇匀*/
//static uint8_t rnd_grid[8] = {				11,			1,		19,							6,			0,		0,					4,			0};
//static uint8_t rnd_test_grid[8] = {		7,			18,		0,							8,			0,		0,					4,			4};
//#endif

#elif PRODUCT_NAME_IVD_400
static method_act_t normal_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_R2|TEST_PROCESS_SAMPLE},
	{1,TEST_RROCESS_SHAKE_SAMPLE},
	{40,TEST_PROCESS_MAGNET},
	{46,TEST_PROCESS_SHAKE_MAGNET},
	{82,TEST_PROCESS_GO_CLEAN},
	{85,TEST_PROCESS_SUCK_P1},
	{86,TEST_PROCESS_SPIT_P1},
	{89,TEST_PROCESS_SUCK_P2},
	{90,TEST_PROCESS_SPIT_P2},
	{93,TEST_PROCESS_SUCK_P3},
	{94,TEST_PROCESS_SPIT_P3},
	{97,TEST_PROCESS_SUCK_P4},
	{98,TEST_PROCESS_REAGENTA},
	{101,TEST_PROCESS_SHAKE_REAGENTA},
	{102,TEST_PROCESS_PMT|TEST_PROCESS_FLASH},
	{103,TEST_PROCESS_WASTE},
};
static method_act_t r2m_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_SAMPLE},
	{1,TEST_RROCESS_SHAKE_SAMPLE},
	{40,TEST_PROCESS_R2_DL|TEST_PROCESS_MAGNET},
	{46,TEST_PROCESS_SHAKE_MAGNET},
	{82,TEST_PROCESS_GO_CLEAN},
	{85,TEST_PROCESS_SUCK_P1},
	{86,TEST_PROCESS_SPIT_P1},
	{89,TEST_PROCESS_SUCK_P2},
	{90,TEST_PROCESS_SPIT_P2},
	{93,TEST_PROCESS_SUCK_P3},
	{94,TEST_PROCESS_SPIT_P3},
	{97,TEST_PROCESS_SUCK_P4},
	{98,TEST_PROCESS_REAGENTA},
	{101,TEST_PROCESS_SHAKE_REAGENTA},
	{102,TEST_PROCESS_PMT|TEST_PROCESS_FLASH},
	{103,TEST_PROCESS_WASTE},
};
static method_act_t dilute_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_RROCESS_DILUTE|TEST_PROCESS_SAMPLE},
	{1,TEST_RROCESS_SHAKE_SAMPLE},
	{15,TEST_RROCESS_DILUTE_SHIFT},
	{82,TEST_PROCESS_GO_CLEAN},
	{85,TEST_PROCESS_SUCK_P1},
	{102,TEST_PROCESS_PMT},
	{103,TEST_PROCESS_WASTE},
};

static method_act_t fast_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_R2|TEST_PROCESS_MAGNET|TEST_PROCESS_SHAKE_MAGNET|TEST_PROCESS_SAMPLE},
	{1,TEST_RROCESS_SHAKE_SAMPLE},
	{2,TEST_PROCESS_GO_CLEAN},
	{5,TEST_PROCESS_SUCK_P1},
	{6,TEST_PROCESS_SPIT_P1},
	{9,TEST_PROCESS_SUCK_P2},
	{10,TEST_PROCESS_SPIT_P2},
	{13,TEST_PROCESS_SUCK_P3},
	{14,TEST_PROCESS_SPIT_P3},
	{17,TEST_PROCESS_SUCK_P4},
	{18,TEST_PROCESS_REAGENTA},
	{21,TEST_PROCESS_SHAKE_REAGENTA},
	{22,TEST_PROCESS_PMT|TEST_PROCESS_FLASH},
	{23,TEST_PROCESS_WASTE},
};
static method_act_t two_step_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_SAMPLE},
	{1,TEST_RROCESS_SHAKE_SAMPLE},
	{40,TEST_PROCESS_MAGNET},
	{46,TEST_PROCESS_SHAKE_MAGNET},
	{82,TEST_PROCESS_GO_CLEAN},
	{85,TEST_PROCESS_SUCK_P1},
	{86,TEST_PROCESS_SPIT_P1},
	{89,TEST_PROCESS_SUCK_P2},
	{90,TEST_PROCESS_SPIT_P2},
	{93,TEST_PROCESS_SUCK_P3},
	{94,TEST_PROCESS_SPIT_P3},
	{97,TEST_PROCESS_SUCK_P4},
	{102,TEST_PROCESS_RELOAD|TEST_PROCESS_R2|TEST_PROCESS_SHAKE_MAGNET},
	{184,TEST_PROCESS_GO_CLEAN},
	{187,TEST_PROCESS_SUCK_P1},
	{188,TEST_PROCESS_SPIT_P1},
	{191,TEST_PROCESS_SUCK_P2},
	{192,TEST_PROCESS_SPIT_P2},
	{195,TEST_PROCESS_SUCK_P3},
	{196,TEST_PROCESS_SPIT_P3},
	{199,TEST_PROCESS_SUCK_P4},
	{200,TEST_PROCESS_REAGENTA},
	{203,TEST_PROCESS_SHAKE_REAGENTA},
	{204,TEST_PROCESS_PMT|TEST_PROCESS_FLASH},
	{205,TEST_PROCESS_WASTE},
};

/*反应盘运动格子数量									去空杯|去清洗|两步法重新温育|加试剂|加磁珠|吸取稀释样本|加样本|摇匀*/
//static uint8_t rnd_grid[8] = {				0,			8,		19,							5,			14,		0,					0,			0};
//static uint8_t rnd_test_grid[8] = {		10,			17,		0,							5,			10,		0,					4,			0};
static uint8_t rnd_grid[8] = {				0,			8,		18,							5,			15,		0,					0,			0};
static uint8_t rnd_test_grid[8] = {		10,			16,		0,							5,			10,		0,					5,			0};
#elif PRODUCT_NAME_IVD_900
static method_act_t normal_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_R2|TEST_PROCESS_SAMPLE},
	{1,TEST_PROCESS_WASTE},
};
static method_act_t r2m_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_SAMPLE},
	{1,TEST_PROCESS_WASTE},
};
static method_act_t dilute_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_RROCESS_DILUTE|TEST_PROCESS_SAMPLE},
	{1,TEST_PROCESS_WASTE},
};

static method_act_t fast_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_R2|TEST_PROCESS_MAGNET|TEST_PROCESS_SHAKE_MAGNET|TEST_PROCESS_SAMPLE},
	{1,TEST_PROCESS_WASTE},
};
static method_act_t two_step_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_SAMPLE},
	{1,TEST_PROCESS_WASTE},
};

/*反应盘运动格子数量									去空杯|去清洗|两步法重新温育|加试剂|加磁珠|吸取稀释样本|加样本|摇匀*/
static uint8_t rnd_grid[8] = {				0,			8,		18,							5,			15,		0,					0,			0};
static uint8_t rnd_test_grid[8] = {		10,			16,		0,							5,			10,		0,					5,			0};
#elif PRODUCT_NAME_IVD_200
static method_act_t normal_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_R2|TEST_PROCESS_SAMPLE},
//	{1,TEST_PROCESS_SAMPLE},
	{2,TEST_RROCESS_SHAKE_SAMPLE},
	{28,TEST_PROCESS_MAGNET},
	{30,TEST_PROCESS_SHAKE_MAGNET},
	{54,TEST_PROCESS_GO_CLEAN},
	{57,TEST_PROCESS_SUCK_P1},
	{58,TEST_PROCESS_SPIT_P1},
	{59,TEST_PROCESS_SUCK_P2},
	{60,TEST_PROCESS_SPIT_P2},
	{61,TEST_PROCESS_SUCK_P3},
	{62,TEST_PROCESS_SPIT_P3},
	{63,TEST_PROCESS_SUCK_P4|TEST_PROCESS_REAGENTA},
	{64,TEST_PROCESS_SHAKE_REAGENTA},
	{65,TEST_PROCESS_PMT},
	{66,TEST_PROCESS_WASTE},
};
static method_act_t r2m_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_SAMPLE},
//	{1,TEST_PROCESS_SAMPLE},
	{2,TEST_RROCESS_SHAKE_SAMPLE},
	{28,TEST_PROCESS_MAGNET|TEST_PROCESS_R2_DL},
	{30,TEST_PROCESS_SHAKE_MAGNET},
	{54,TEST_PROCESS_GO_CLEAN},
	{57,TEST_PROCESS_SUCK_P1},
	{58,TEST_PROCESS_SPIT_P1},
	{59,TEST_PROCESS_SUCK_P2},
	{60,TEST_PROCESS_SPIT_P2},
	{61,TEST_PROCESS_SUCK_P3},
	{62,TEST_PROCESS_SPIT_P3},
	{63,TEST_PROCESS_SUCK_P4|TEST_PROCESS_REAGENTA},
	{64,TEST_PROCESS_SHAKE_REAGENTA},
	{65,TEST_PROCESS_PMT},
	{66,TEST_PROCESS_WASTE},
};
static method_act_t fast_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_R2|TEST_PROCESS_MAGNET|TEST_PROCESS_SHAKE_MAGNET|TEST_PROCESS_SAMPLE|TEST_RROCESS_SHAKE_SAMPLE},
//	{1,TEST_PROCESS_SAMPLE|TEST_RROCESS_SHAKE_SAMPLE},
	{2,TEST_PROCESS_GO_CLEAN},
	{5,TEST_PROCESS_SUCK_P1},
	{6,TEST_PROCESS_SPIT_P1},
	{7,TEST_PROCESS_SUCK_P2},
	{8,TEST_PROCESS_SPIT_P2},
	{9,TEST_PROCESS_SUCK_P3},
	{10,TEST_PROCESS_SPIT_P3},
	{11,TEST_PROCESS_SUCK_P4|TEST_PROCESS_REAGENTA},
	{12,TEST_PROCESS_SHAKE_REAGENTA},
	{13,TEST_PROCESS_PMT},
	{14,TEST_PROCESS_WASTE},
};
static method_act_t two_step_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_PROCESS_R1|TEST_PROCESS_SAMPLE},
	{1,TEST_PROCESS_SAMPLE},
	{2,TEST_RROCESS_SHAKE_SAMPLE},
	{28,TEST_PROCESS_MAGNET},
	{30,TEST_PROCESS_SHAKE_MAGNET},
	{54,TEST_PROCESS_GO_CLEAN},
	{57,TEST_PROCESS_SUCK_P1},
	{58,TEST_PROCESS_SPIT_P1},
	{59,TEST_PROCESS_SUCK_P2},
	{60,TEST_PROCESS_SPIT_P2},
	{61,TEST_PROCESS_SUCK_P3},
	{62,TEST_PROCESS_SPIT_P3},
	{63,TEST_PROCESS_SUCK_P4},
	{65,TEST_PROCESS_RELOAD|TEST_PROCESS_R2},
	{67,TEST_RROCESS_SHAKE_SAMPLE},
	{119,TEST_PROCESS_GO_CLEAN},
	{122,TEST_PROCESS_SUCK_P1},
	{123,TEST_PROCESS_SPIT_P1},
	{124,TEST_PROCESS_SUCK_P2},
	{125,TEST_PROCESS_SPIT_P2},
	{126,TEST_PROCESS_SUCK_P3},
	{127,TEST_PROCESS_SPIT_P3},
	{128,TEST_PROCESS_SUCK_P4|TEST_PROCESS_REAGENTA},
	{129,TEST_PROCESS_SHAKE_REAGENTA},
	{130,TEST_PROCESS_PMT},
	{131,TEST_PROCESS_WASTE},
};
static method_act_t dilute_method_list[]={
	{0,TEST_PROCESS_LOAD|TEST_RROCESS_DILUTE|TEST_PROCESS_SAMPLE},
//	{1,TEST_RROCESS_SHAKE_SAMPLE},
	{4,TEST_RROCESS_DILUTE_SHIFT},
//	{5,TEST_RROCESS_DILUTE_NEW},
//	{5,TEST_RROCESS_DILUTE_SHIFT},
	{54,TEST_PROCESS_GO_CLEAN},
	{57,TEST_PROCESS_SUCK_P1},
	{65,TEST_PROCESS_PMT},
	{66,TEST_PROCESS_WASTE},
};

/*反应盘运动格子数量									去空杯|去清洗|两步法重新温育|加试剂|加磁珠|吸取稀释样本|加样本|摇匀*/
//static uint8_t rnd_grid[8] = {				15,			10,		0,							5,			3,		0,					0,			0};
static uint8_t rnd_grid[8] = {				14,			10,		22,							15,			4,		0,					0,			0};
static uint8_t rnd_test_grid[8] = {		14,			30,		0,							17,			0,		0,					4,			0};
#endif
/*
*********************************************************************************************************
*                                               本地函数声明
*********************************************************************************************************
*/

static test_process_t get_tube_process(uint32_t period,tube_t* p_tube);
/*
*********************************************************************************************************
*					
*********************************************************************************************************
*/

void* process_get_tube(uint32_t period,test_process_t process)
{

	return NULL;
}

static test_process_t get_tube_process(uint32_t period,tube_t* p_tube)
{
	if(p_tube == NULL)
		return TEST_PROCESS_NULL;
	uint32_t tube_period = period - p_tube->period;
	method_act_t* p_method = normal_method_list;
	uint32_t list_size = sizeof(normal_method_list)/sizeof(method_act_t);
	if(SYSTEM_CFG->schedule_mod == SCHEDULE_MOD_CLEAN_TEST)
	{
		p_method = fast_method_list;
		list_size = sizeof(fast_method_list)/sizeof(method_act_t);
		p_tube->method = METHOD_FAST;
	}
#if PRODUCT_NAME_DESKTOP_200|PRODUCT_NAME_IVD_400
	else if(p_tube->method & METHOD_DILUTE_MSK)
	{
		p_method = dilute_method_list;
		list_size = sizeof(dilute_method_list)/sizeof(method_act_t);
	}
#endif
#if PRODUCT_NAME_DESKTOP_200 | PRODUCT_NAME_IVD_200 | PRODUCT_NAME_IVD_400
	else if(p_tube->method == METHOD_R2M)
	{
		p_method = r2m_method_list;
		list_size = sizeof(r2m_method_list)/sizeof(method_act_t);
	}
	else if(p_tube->method == METHOD_TWO_STEP)
	{
		p_method = two_step_method_list;
		list_size = sizeof(two_step_method_list)/sizeof(method_act_t);
	}
#elif PRODUCT_NAME_IVD_400
#endif
	for(uint8_t index = 0;index < list_size;index++)
	{
		if(p_method[index].period_cnt == tube_period)
			return p_method[index].process_act;
	}
	return TEST_PROCESS_NULL;
}
/*根据测试类型和步骤返回该步骤发送周期数*/
uint32_t get_process_period(method_t method,test_process_t process)
{
	uint32_t list_size;
	method_act_t* p_method = normal_method_list;
	switch(method)
	{
		case METHOD_FAST:
			p_method = fast_method_list;
			list_size = sizeof(fast_method_list)/sizeof(method_act_t);
			break;
		case METHOD_NORMAL:
			p_method = normal_method_list;
			list_size = sizeof(normal_method_list)/sizeof(method_act_t);
			break;
		case METHOD_R2M:
			p_method = r2m_method_list;
			list_size = sizeof(r2m_method_list)/sizeof(method_act_t);
			break;
#if PRODUCT_NAME_DESKTOP_200 | PRODUCT_NAME_IVD_200 | PRODUCT_NAME_IVD_400 | PRODUCT_NAME_IVD_900
		case METHOD_TWO_STEP:
			p_method = two_step_method_list;
			list_size = sizeof(two_step_method_list)/sizeof(method_act_t);
			break;
#endif
		default:break;
	}
#if PRODUCT_NAME_DESKTOP_200 | PRODUCT_NAME_IVD_200 | PRODUCT_NAME_IVD_400 | PRODUCT_NAME_IVD_900
	if(METHOD_DILUTE_MSK & method)
	{
		p_method = dilute_method_list;
		list_size = sizeof(dilute_method_list)/sizeof(method_act_t);
	}
#endif
	for(uint16_t index = 0;index < list_size;index++)
	{
		if(p_method[index].process_act & process)
		{
			return p_method[index].period_cnt;
		}
	}
	return 0xff;
}
uint8_t rnd_get_grid(rnd_grid_t pos)
{
	ASSERT(pos <= RND_SHAKE_GRID);
	if(SYSTEM_CFG->schedule_mod == SCHEDULE_MOD_CLEAN_TEST)
		return rnd_test_grid[pos];
	return rnd_grid[pos];
}